/*import java.io.*;
import java.util.LinkedList;
import java.util.List;
import java.util.Scanner;

public class Main {
    private static List<Book> books;
    static Scanner sc=new Scanner(System.in);
    public static void main(String[] args) {
        System.out.println("正在初始化图书管理系统...");
        load();
        System.out.println("图书管理系统初始化成功,欢迎使用");

        while(true){
            System.out.println("============= 图书管理系统 ===============");
            System.out.println("如果想录入书籍信息,请输入1");
            System.out.println("如果想查询书籍信息，请输入2");
            System.out.println("如果想删除书籍信息，请输入3");
            System.out.println("如果想修改书籍信息,请输入4");
            System.out.println("如果想清空书籍信息,请输入5");
            System.out.println("如果想退出系统，录入查询，删除，修改清空退出。请输入6");
            System.out.println("=========================================");
            int i=sc.nextInt();
            if(i==1){
                insert();
            }
            if(i==2){
                list();
            }
            if(i==3){
                delete();
            }
            if(i==4){
                modify();
            }
            if(i==5){
                empty();
            }
            if(i==6){
                System.out.println("正在保存图书数据数据...");
                save();
                System.out.println("图书数据保存成功,感谢你的使用,再见!");
                return;
            }
        }
    }

    private static void insert(){
        sc.nextLine();
        System.out.print("请输入书籍的标题:");
        String title=sc.nextLine();
        System.out.print("请输入书籍的作者:");
        String author=sc.nextLine();
        System.out.print("请输入书籍的价格:");
        int price=sc.nextInt();
        sc.nextLine();
        Book book=new Book(title,author,price);
        books.add(book);
        System.out.println("书籍信息添加成功:"+book);
    }

    private static void modify(){
        sc.nextLine();
        System.out.print("请输入你要修改的书籍ID编号:");
        int id=sc.nextInt();
        sc.nextLine();
        while(id>books.size()-1||id<0){
            System.out.print("没有对应的书籍，请重新输入:");
            id=sc.nextInt();
            sc.nextLine();
        }
        Book book=books.get(id);
        System.out.print("请输入书籍的标题:");
        book.setTitle(sc.nextLine());
        System.out.print("请输入书籍的作者:");
        book.setAuthor(sc.nextLine());
        System.out.print("请输入书籍的价格:");
        book.setPrice(sc.nextInt());
        sc.nextLine();
        System.out.println("第"+id+"号书籍信息修改成功");
    }

    private static void list(){
        if(books.isEmpty()){
            System.out.println("目前还没有存入书籍");
            return;
        }
        for(int i=0;i<books.size();i++){
            System.out.println(i+"."+books.get(i));
        }
    }

    private static void delete(){
        sc.nextLine();
        System.out.print("请输入您要删除的书籍ID编号:");
        int id=sc.nextInt();
        sc.nextLine();
        while(id>books.size()-1||id<0){
            System.out.println("还有对应的书籍，请重新输入:");
            id=sc.nextInt();
            sc.nextLine();
        }
        books.remove(id);
        System.out.println("删除第"+id+"号书籍信息成功！");
    }

    private static void load(){
        File file=new File("data.txt");
        if(file.exists()){
            try(ObjectInputStream in=new ObjectInputStream(new FileInputStream(file))){
                books=(List<Book>)in.readObject();
            }
            catch(IOException e){
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                throw new RuntimeException(e);
            }
        }else{
            books=new LinkedList<>();
        }
    }

    private static void save(){
        try(ObjectOutputStream stream =new ObjectOutputStream(new FileOutputStream("data.txt"))){
            stream.writeObject(books);
            stream.flush();
        }catch(IOException e){
            e.printStackTrace();
        }
    }

    public static void empty(){
        books.clear();
    }


}*/